<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>快递签收</title>
<%@ include file="/pages/wx/baseHead.jsp"%>
<script type="text/javascript">
	
	$(function(){
		//initWxSdk();
		var state = '${obj.state}';
		if(state == '04' || state == '03')
		{
			$("#operA").addClass('weui_btn_plain_primary');
			$("#operA").click(function(){
				dilivery();
			});
			$("#operFont").html("签收");
		}else if(state == '05')
		{
			$("#operA").addClass('weui_btn_plain_default');
			$("#operFont").html("已签收");
		}
	});
	
	
	/*签收*/
	function dilivery()
	{
		var sn = $("#sn").val();
		debugger;
		confirm('提示','确定签收？',function(){
			var url = '${urlBasePath}weixin/expressReceive.do';
			$.ajax({
				url:url,
				async:true,
				data:{
					sn:sn
				},
				success:function(ret){
					if(ret.code == '0')
					{
						openToast('操作成功');
						$("#operA").addClass('weui_btn_plain_default');
						$("#operA").unbind();
						$("#operFont").html("已签收");
					}else
					{
						openDia('提示',ret.msg);
					}
				},
				error:function(){
					alert('系统错误');
				}
			});
			
		});
	}
	
	
</script>

</head>
<body>
<input type="hidden" id="sn" value="${obj.sn }">
<div class="bd" id="orderInfo">
   <div class="weui_panel weui_panel_access">
   	<div class="weui_panel_hd">
       	<div align="center">
        	<a class="weui_btn" id="operA">
        		<i class="fa fa-cart-plus fa-fw"></i><font id="operFont">签收</font>
        	</a>
      	 	</div>
      	 	<div align="center" style="color: red;padding-top: 10px;">
         		请确保收到快递再点击签收按钮
         </div>
       </div>
       <div class="weui_panel_bd">
           <a href="javascript:void(0);" class="weui_media_box weui_media_appmsg form-inline">
               <div class="weui_media_bd">
                   <h4 class="weui_media_title">快递公司：${obj.expressMercName }</h4>
                  <p class="weui_media_desc">
                   	<i class="fa fa-male fa-fw"></i>物品：${obj.goodsType } ${obj.weight } kg 
                   	&nbsp;
                   	<i class="fa fa-cny fa-fw"></i>保价：
                   	<fmt:formatNumber value="${null == obj.supportValue?0:obj.supportValue }" pattern="#,##0.00"/>元
                   </p>
                   <p class="weui_media_desc"><i class="fa fa-th-list fa-fw"></i>订单号：${obj.sn }</p>
                   <p class="weui_media_desc"><i class="fa fa-barcode fa-fw"></i>条形码：<font id="barcodeFont">${obj.barCode }</font></p>
                   <p class="weui_media_desc"><i class="fa fa-reorder fa-fw"></i>快递单：<font id="expcodeFont">${obj.expressNo }</font></p>
               </div>
           </a>
       </div>
       
       <div class="weui_panel_hd" style="font-size: 1.2em;">收件人信息</div>
       <div class="weui_panel_bd">
           <a href="javascript:void(0);" class="weui_media_box weui_media_appmsg form-inline">
               <div class="weui_media_bd">
                   <h4 class="weui_media_title">收件人：${obj.directionName }</h4>
                   <p class="weui_media_desc"><i class="fa fa-phone fa-fw"></i>电话：${obj.directionPhone }</p>
                   <p class="weui_media_desc"><i class="fa fa-location-arrow fa-fw"></i>地址：${obj.directionAddress }</p>
               </div>
           </a>
       </div>
       
       <div class="weui_panel_hd" style="font-size: 1.2em;">寄件人信息</div>
       <div class="weui_panel_bd">
           <a href="javascript:void(0);" class="weui_media_box weui_media_appmsg form-inline">
               <div class="weui_media_bd">
                   <h4 class="weui_media_title">寄件人：${obj.fromName }</h4>
                   <p class="weui_media_desc"><i class="fa fa-phone fa-fw"></i>电话：${obj.fromPhone }</p>
                   <p class="weui_media_desc"><i class="fa fa-location-arrow fa-fw"></i>地址：${obj.fromAddress }</p>
                </div>
            </a>
        </div>
    </div>
</div>

<div class="pop">
    <i class="fa fa-home fa-lg popi"></i>
</div>

<!-- 引入微信样式代码提示工具开始 -->
<%@ include file="/pages/wx/wxClass.jsp"%>
<!-- 引入微信样式代码提示工具结束 -->
<%@ include file="/pages/wx/baseBottom.jsp"%>
</body>
</html>

